<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=UTF-8"%>
<%@ include file="/includes/taglibs.jsp"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>历史记录|金水科技消息推送平台</title>
<meta name="menu" content="history" />
<link rel="stylesheet" type="text/css" href="<c:url value='/styles/tablesorter/style.css'/>" />
<script type="text/javascript" src="<c:url value='/scripts/jquery.tablesorter.js'/>"></script>
</head>

<body>

<h1>Notifications</h1>
<pg:pager items="${total}" url="notification.do" maxIndexPages="15">
<pg:param name="action" value="history" />  
	<pg:first><a href="${pageUrl}">首页</a></pg:first>
	<pg:prev><a href="${pageUrl}">上一页</a></pg:prev>
	<pg:pages>
	<c:if test="${nowPage eq pageNumber}"><font color=red>${pageNumber}</font>&nbsp;</c:if>
	<c:if test="${nowPage != pageNumber}"><a href="${pageUrl}">${pageNumber}</a>&nbsp;</c:if>
	
	
	</pg:pages>
	<pg:next><a href="${pageUrl}">下一页</a></pg:next>
	<pg:last><a href="${pageUrl}">尾页</a></pg:last>
</pg:pager>
<table id="tableList" class="tablesorter" cellspacing="1">
	<thead>
		<tr>
			<%--
			<th width="5%">Online</th>
			<th width="30%">Username</th>
			<th width="20%">Name</th>
			<th width="20%">Email</th>
			<th width="25%">Created</th>
			--%>
			<th>编号</th>
			<th>接受者</th>
			<th>消息标题</th>
			<th>消息内容</th>
			<th>状态</th>
			<th>发送时间</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="no" items="${list}">
			<tr>
				<td align="center">
				<c:out value="${no.id}"></c:out>
				</td>
				<td><c:out value="${no.username}" /></td>
				<td><c:out value="${no.title}" /></td>
				<td width="40%"><c:out value="${no.message}" /></td>
				<td><c:choose>
					<c:when test="${no.status eq 0}">
						<font color=black>待发送</font>
					</c:when>
					<c:when test="${no.status eq 1}">
						<font color=blue>已发送</font>
					</c:when>
					<c:when test="${no.status eq 2}">
						<font color=orange>已接收</font>
					</c:when>
					<c:when test="${no.status eq 3}">
						<font color=green>已阅读</font>
					</c:when>
					</c:choose></td>
				<td align="center"><fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${no.updateTime}" /></td>
			</tr>
		</c:forEach>
	</tbody>
</table>

<script type="text/javascript">
//<![CDATA[
$(function() {
	$('#tableList').tablesorter();
	//$('#tableList').tablesorter( {sortList: [[0,0], [1,0]]} );
	//$('table tr:nth-child(odd)').addClass('odd');
	$('table tr:nth-child(even)').addClass('even');	 
});
//]]>
</script>

</body>
</html>
